\(\int \frac {x^2 (a+b \log (c x^n))}{d+e x^2} \, dx\) [217]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (warning: unable to verify)
   Fricas [F]
   Sympy [F]
   Maxima [F(-2)]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 23, antiderivative size = 132 \[ \int \frac {x^2 \left (a+b \log \left (c x^n\right )\right )}{d+e x^2} \, dx=\frac {a x}{e}-\frac {b n x}{e}+\frac {b x \log \left (c x^n\right )}{e}-\frac {\sqrt {d} \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right ) \left (a+b \log \left (c x^n\right )\right )}{e^{3/2}}+\frac {i b \sqrt {d} n \operatorname {PolyLog}\left (2,-\frac {i \sqrt {e} x}{\sqrt {d}}\right )}{2 e^{3/2}}-\frac {i b \sqrt {d} n \operatorname {PolyLog}\left (2,\frac {i \sqrt {e} x}{\sqrt {d}}\right )}{2 e^{3/2}} \]

[Out]

a*x/e-b*n*x/e+b*x*ln(c*x^n)/e-arctan(x*e^(1/2)/d^(1/2))*(a+b*ln(c*x^n))*d^(1/2)/e^(3/2)+1/2*I*b*n*polylog(2,-I
*x*e^(1/2)/d^(1/2))*d^(1/2)/e^(3/2)-1/2*I*b*n*polylog(2,I*x*e^(1/2)/d^(1/2))*d^(1/2)/e^(3/2)

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 132, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.348, Rules used = {327, 211, 2393, 2332, 2361, 12, 4940, 2438} \[ \int \frac {x^2 \left (a+b \log \left (c x^n\right )\right )}{d+e x^2} \, dx=-\frac {\sqrt {d} \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right ) \left (a+b \log \left (c x^n\right )\right )}{e^{3/2}}+\frac {a x}{e}+\frac {b x \log \left (c x^n\right )}{e}+\frac {i b \sqrt {d} n \operatorname {PolyLog}\left (2,-\frac {i \sqrt {e} x}{\sqrt {d}}\right )}{2 e^{3/2}}-\frac {i b \sqrt {d} n \operatorname {PolyLog}\left (2,\frac {i \sqrt {e} x}{\sqrt {d}}\right )}{2 e^{3/2}}-\frac {b n x}{e} \]

[In]

Int[(x^2*(a + b*Log[c*x^n]))/(d + e*x^2),x]

[Out]

(a*x)/e - (b*n*x)/e + (b*x*Log[c*x^n])/e - (Sqrt[d]*ArcTan[(Sqrt[e]*x)/Sqrt[d]]*(a + b*Log[c*x^n]))/e^(3/2) +
((I/2)*b*Sqrt[d]*n*PolyLog[2, ((-I)*Sqrt[e]*x)/Sqrt[d]])/e^(3/2) - ((I/2)*b*Sqrt[d]*n*PolyLog[2, (I*Sqrt[e]*x)
/Sqrt[d]])/e^(3/2)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2361

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/((d_) + (e_.)*(x_)^2), x_Symbol] :> With[{u = IntHide[1/(d + e*x^2),
 x]}, Simp[u*(a + b*Log[c*x^n]), x] - Dist[b*n, Int[u/x, x], x]] /; FreeQ[{a, b, c, d, e, n}, x]

Rule 2393

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> Wit
h[{u = ExpandIntegrand[a + b*Log[c*x^n], (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c,
d, e, f, m, n, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IntegerQ[m] && IntegerQ[r]))

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 4940

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))/(x_), x_Symbol] :> Simp[a*Log[x], x] + (Dist[I*(b/2), Int[Log[1 - I*c*x
]/x, x], x] - Dist[I*(b/2), Int[Log[1 + I*c*x]/x, x], x]) /; FreeQ[{a, b, c}, x]

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {a+b \log \left (c x^n\right )}{e}-\frac {d \left (a+b \log \left (c x^n\right )\right )}{e \left (d+e x^2\right )}\right ) \, dx \\ & = \frac {\int \left (a+b \log \left (c x^n\right )\right ) \, dx}{e}-\frac {d \int \frac {a+b \log \left (c x^n\right )}{d+e x^2} \, dx}{e} \\ & = \frac {a x}{e}-\frac {\sqrt {d} \tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right ) \left (a+b \log \left (c x^n\right )\right )}{e^{3/2}}+\frac {b \int \log \left (c x^n\right ) \, dx}{e}+\frac {(b d n) \int \frac {\tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {d} \sqrt {e} x} \, dx}{e} \\ & = \frac {a x}{e}-\frac {b n x}{e}+\frac {b x \log \left (c x^n\right )}{e}-\frac {\sqrt {d} \tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right ) \left (a+b \log \left (c x^n\right )\right )}{e^{3/2}}+\frac {\left (b \sqrt {d} n\right ) \int \frac {\tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{x} \, dx}{e^{3/2}} \\ & = \frac {a x}{e}-\frac {b n x}{e}+\frac {b x \log \left (c x^n\right )}{e}-\frac {\sqrt {d} \tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right ) \left (a+b \log \left (c x^n\right )\right )}{e^{3/2}}+\frac {\left (i b \sqrt {d} n\right ) \int \frac {\log \left (1-\frac {i \sqrt {e} x}{\sqrt {d}}\right )}{x} \, dx}{2 e^{3/2}}-\frac {\left (i b \sqrt {d} n\right ) \int \frac {\log \left (1+\frac {i \sqrt {e} x}{\sqrt {d}}\right )}{x} \, dx}{2 e^{3/2}} \\ & = \frac {a x}{e}-\frac {b n x}{e}+\frac {b x \log \left (c x^n\right )}{e}-\frac {\sqrt {d} \tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right ) \left (a+b \log \left (c x^n\right )\right )}{e^{3/2}}+\frac {i b \sqrt {d} n \text {Li}_2\left (-\frac {i \sqrt {e} x}{\sqrt {d}}\right )}{2 e^{3/2}}-\frac {i b \sqrt {d} n \text {Li}_2\left (\frac {i \sqrt {e} x}{\sqrt {d}}\right )}{2 e^{3/2}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 170, normalized size of antiderivative = 1.29 \[ \int \frac {x^2 \left (a+b \log \left (c x^n\right )\right )}{d+e x^2} \, dx=\frac {2 a \sqrt {e} x-2 b \sqrt {e} n x+2 b \sqrt {e} x \log \left (c x^n\right )-\sqrt {-d} \left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {\sqrt {e} x}{\sqrt {-d}}\right )+\sqrt {-d} \left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {d \sqrt {e} x}{(-d)^{3/2}}\right )+b \sqrt {-d} n \operatorname {PolyLog}\left (2,\frac {\sqrt {e} x}{\sqrt {-d}}\right )-b \sqrt {-d} n \operatorname {PolyLog}\left (2,\frac {d \sqrt {e} x}{(-d)^{3/2}}\right )}{2 e^{3/2}} \]

[In]

Integrate[(x^2*(a + b*Log[c*x^n]))/(d + e*x^2),x]

[Out]

(2*a*Sqrt[e]*x - 2*b*Sqrt[e]*n*x + 2*b*Sqrt[e]*x*Log[c*x^n] - Sqrt[-d]*(a + b*Log[c*x^n])*Log[1 + (Sqrt[e]*x)/
Sqrt[-d]] + Sqrt[-d]*(a + b*Log[c*x^n])*Log[1 + (d*Sqrt[e]*x)/(-d)^(3/2)] + b*Sqrt[-d]*n*PolyLog[2, (Sqrt[e]*x
)/Sqrt[-d]] - b*Sqrt[-d]*n*PolyLog[2, (d*Sqrt[e]*x)/(-d)^(3/2)])/(2*e^(3/2))

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 0.41 (sec) , antiderivative size = 317, normalized size of antiderivative = 2.40

method result size
risch \(\frac {b \ln \left (x^{n}\right ) x}{e}+\frac {b d \arctan \left (\frac {x e}{\sqrt {d e}}\right ) n \ln \left (x \right )}{e \sqrt {d e}}-\frac {b d \arctan \left (\frac {x e}{\sqrt {d e}}\right ) \ln \left (x^{n}\right )}{e \sqrt {d e}}-\frac {b n x}{e}-\frac {b n d \ln \left (x \right ) \ln \left (\frac {-e x +\sqrt {-d e}}{\sqrt {-d e}}\right )}{2 e \sqrt {-d e}}+\frac {b n d \ln \left (x \right ) \ln \left (\frac {e x +\sqrt {-d e}}{\sqrt {-d e}}\right )}{2 e \sqrt {-d e}}-\frac {b n d \operatorname {dilog}\left (\frac {-e x +\sqrt {-d e}}{\sqrt {-d e}}\right )}{2 e \sqrt {-d e}}+\frac {b n d \operatorname {dilog}\left (\frac {e x +\sqrt {-d e}}{\sqrt {-d e}}\right )}{2 e \sqrt {-d e}}+\left (-\frac {i b \pi \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )}{2}+\frac {i b \pi \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}+\frac {i b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}-\frac {i b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}}{2}+b \ln \left (c \right )+a \right ) \left (\frac {x}{e}-\frac {d \arctan \left (\frac {x e}{\sqrt {d e}}\right )}{e \sqrt {d e}}\right )\) \(317\)

[In]

int(x^2*(a+b*ln(c*x^n))/(e*x^2+d),x,method=_RETURNVERBOSE)

[Out]

b*ln(x^n)/e*x+b*d/e/(d*e)^(1/2)*arctan(x*e/(d*e)^(1/2))*n*ln(x)-b*d/e/(d*e)^(1/2)*arctan(x*e/(d*e)^(1/2))*ln(x
^n)-b*n*x/e-1/2*b*n*d/e*ln(x)/(-d*e)^(1/2)*ln((-e*x+(-d*e)^(1/2))/(-d*e)^(1/2))+1/2*b*n*d/e*ln(x)/(-d*e)^(1/2)
*ln((e*x+(-d*e)^(1/2))/(-d*e)^(1/2))-1/2*b*n*d/e/(-d*e)^(1/2)*dilog((-e*x+(-d*e)^(1/2))/(-d*e)^(1/2))+1/2*b*n*
d/e/(-d*e)^(1/2)*dilog((e*x+(-d*e)^(1/2))/(-d*e)^(1/2))+(-1/2*I*b*Pi*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)+1/2*I
*b*Pi*csgn(I*c)*csgn(I*c*x^n)^2+1/2*I*b*Pi*csgn(I*x^n)*csgn(I*c*x^n)^2-1/2*I*b*Pi*csgn(I*c*x^n)^3+b*ln(c)+a)*(
x/e-d/e/(d*e)^(1/2)*arctan(x*e/(d*e)^(1/2)))

Fricas [F]

\[ \int \frac {x^2 \left (a+b \log \left (c x^n\right )\right )}{d+e x^2} \, dx=\int { \frac {{\left (b \log \left (c x^{n}\right ) + a\right )} x^{2}}{e x^{2} + d} \,d x } \]

[In]

integrate(x^2*(a+b*log(c*x^n))/(e*x^2+d),x, algorithm="fricas")

[Out]

integral((b*x^2*log(c*x^n) + a*x^2)/(e*x^2 + d), x)

Sympy [F]

\[ \int \frac {x^2 \left (a+b \log \left (c x^n\right )\right )}{d+e x^2} \, dx=\int \frac {x^{2} \left (a + b \log {\left (c x^{n} \right )}\right )}{d + e x^{2}}\, dx \]

[In]

integrate(x**2*(a+b*ln(c*x**n))/(e*x**2+d),x)

[Out]

Integral(x**2*(a + b*log(c*x**n))/(d + e*x**2), x)

Maxima [F(-2)]

Exception generated. \[ \int \frac {x^2 \left (a+b \log \left (c x^n\right )\right )}{d+e x^2} \, dx=\text {Exception raised: ValueError} \]

[In]

integrate(x^2*(a+b*log(c*x^n))/(e*x^2+d),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(e>0)', see `assume?` for more
details)Is e

Giac [F]

\[ \int \frac {x^2 \left (a+b \log \left (c x^n\right )\right )}{d+e x^2} \, dx=\int { \frac {{\left (b \log \left (c x^{n}\right ) + a\right )} x^{2}}{e x^{2} + d} \,d x } \]

[In]

integrate(x^2*(a+b*log(c*x^n))/(e*x^2+d),x, algorithm="giac")

[Out]

integrate((b*log(c*x^n) + a)*x^2/(e*x^2 + d), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {x^2 \left (a+b \log \left (c x^n\right )\right )}{d+e x^2} \, dx=\int \frac {x^2\,\left (a+b\,\ln \left (c\,x^n\right )\right )}{e\,x^2+d} \,d x \]

[In]

int((x^2*(a + b*log(c*x^n)))/(d + e*x^2),x)

[Out]

int((x^2*(a + b*log(c*x^n)))/(d + e*x^2), x)